package com.sunday.common.easy.excel.dto;

import com.sunday.common.core.gson.GsonUtils;
import lombok.Data;

import java.io.Serializable;

@Data
public class UploadBlacklistLibraryResDTO implements Serializable {

    /**
     * 成功条数
     */
    private long successful;

    /**
     * 失败条数
     */
    private long failure;

    /**
     * 递增失败
     */
    public void incrFailureCount() {
        failure++;
    }

    /**
     * 指定数量累加失败
     */
    public void incrByFailureCount(long failureCount) {
        failure += failureCount;
    }

    @Override
    public String toString() {
        return GsonUtils.DEFAULT.toJson(this);
    }
}
